package com.me.iot.starter;

import com.me.iot.domain.MeIOTConfigInfo;
import com.me.iot.tools.ConfigurationLoadTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 基于配置文件的服务启动器
 */
@Component
public class YmlFileMeIOTActiveStarter implements MeIOTActiveStarter{
    @Autowired
    ConfigurationLoadTool loadTool;

    @Override
    public void loadConfig() {
        MeIOTConfigInfo iotConfigInfo = loadTool.doRead();
        startServer(iotConfigInfo);
    }

    @Override
    public void startServer(MeIOTConfigInfo configInfo) {
        configInfo.iotServerHandler(); //启动服务端
    }
}
